<?php
require_once("../Connections/conec.php");
include("../Mantenciones/funcionesExamenesAlumnos.php");


//$rutalumno = $_GET['rutid'];

/**************************************
OBTENER DATOS ALUMNO EXAMEN HABILITANTE
*************************************/
function ObtenerRegistroEH($rut){
	$link = Conectarse();
	$registroEH;
	$result = mysql_query("SELECT * FROM examen_habilitante WHERE RUT = $rut ORDER BY FECHA_HABILITANTE DESC", $link);
	$i = 1;
	$r;
	while($row=mysql_fetch_array($result)){
		$r[0] = $row['COD_EXHABILITANTE'];
		$r[1] = $row['RUT'];
		$r[2] = $row['PORD_CIVIL'];
		$r[3] = $row['PORD_PROCESAL'];
		$r[4] = $row['PORD_CONSTITUCIONAL'];
		$r[5] = date("d-m-Y",strtotime($row['FECHA_HABILITANTE']));
		$r[6] = $row['EVALUACION'];
		$registroEH[$i-1] = $r;
		$i++;
	}	
	mysql_close($link);
	return $registroEH;
	
}


function ObtenerRegistroEG($rut){
	$link = Conectarse();
	$registroEG;
	$result = mysql_query("SELECT * FROM examen_de_grado WHERE RUT = $rut ORDER BY FECHA_GRADO DESC", $link);
	$i = 1;
	$r;
	while($row=mysql_fetch_array($result)){
		$r[0] = $row['COD_EXGRADO'];
		$r[1] = $row['RUT'];
		$r[2] = $row['NOTA_INFORME_ESCRITO'];
		$r[3] = $row['NOTA_INFORME_ORAL'];
		$r[4] = $row['CARRERA'];
		$r[5] = $row['NOTA_FINAL'];
		$r[6] = date("d-m-Y",strtotime($row['FECHA_GRADO']));
		$registroEG[$i-1] = $r;
		$i++;
	}
	mysql_close($link);
	return $registroEG;


}

function ObtenerRegistroET($rut){
	$link = Conectarse();
	$registroEG;
	$result = mysql_query("SELECT * FROM examen_tradicional WHERE RUT = $rut ORDER BY FECHA_EXAMEN DESC", $link);
	$i = 1;
	$r;
	while($row=mysql_fetch_array($result)){
		$r[0] = $row['COD_EXTRADICIONAL'];
		$r[1] = $row['RUT'];
		$r[2] = $row['GRADO'];
		$r[3] = $row['NOTA_EXAMEN'];
		$r[4] = $row['PORQUE_LO_REPROBO'];
		$r[5] = date("d-m-Y",strtotime($row['FECHA_EXAMEN']));
		$registroEG[$i-1] = $r;
		$i++;
	}
	mysql_close($link);
	return $registroEG;
}
?>